import * as BABYLON from '@babylonjs/core';
export class LightBuilder {
    public static createLight(scene: BABYLON.Scene, cls: string): BABYLON.Light {
        switch(cls) {
            // 下面的没有阴影的灯，所以没有位置。
            case BABYLON.HemisphericLight.name:
                var hemisphericLight = new BABYLON.HemisphericLight("light", new BABYLON.Vector3(0, 1, 0), scene);
                return hemisphericLight;
            case BABYLON.RectAreaLight.name:
                return new BABYLON.RectAreaLight("light", new BABYLON.Vector3(0, 1, 0), 1,1, scene);

            // 下面的有阴影的灯
            case BABYLON.DirectionalLight.name:
                return new BABYLON.DirectionalLight("light", new BABYLON.Vector3(0, 1, 0), scene);
            case BABYLON.PointLight.name:
                return new BABYLON.PointLight("light", new BABYLON.Vector3(0, 1, 0), scene);
            case BABYLON.SpotLight.name:
                return new BABYLON.SpotLight("light", new BABYLON.Vector3(0, 1, 0), new BABYLON.Vector3(0, 1, 0), Math.PI / 4, 2, scene);
            
            default:
                throw cls + ' light is not supported.';
        }
    }
}